#include<stdio.h>
int main()
{
	int n;
	scanf("%d",&n);
	if(n<0)
		printf("Invalid Value!");
	else if(n<=50)
		printf("cost = %.2f",0.53*n);
	else
		printf("cost = %.2f",0.53*50+(n-50)*0.58);
	return 0;
}
